package io.mft.flow.core.executable.drive;

import cn.hutool.core.util.ReflectUtil;
import io.mft.flow.core.executable.drive.impl.IterateLoopSyncReturnChainConditionDriver;
import io.mft.flow.core.executable.drive.impl.NoneDeliverReturnChainConditionDriver;
import io.mft.flow.core.executable.drive.impl.PipelineChainConditionDriver;

public enum ConditionDriverType {
	noneDeliverReturn(NoneDeliverReturnChainConditionDriver.class), iterateLoopSyncReturn(IterateLoopSyncReturnChainConditionDriver.class),pipeline(PipelineChainConditionDriver.class);
	
	Class<?> classType;
	private <T extends ChainConditionDriver> ConditionDriverType(Class<T> classType) {
		this.classType=classType;
	}
	
	@SuppressWarnings("unchecked")
	public <T extends ChainConditionDriver> T chainConditionDriver() {
		return (T)ReflectUtil.newInstance(classType);
	}
}
